home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
winexit
/
winexit.bas
< prev
next >
Wrap
BASIC Source File
|
1994-08-26
|
2KB
|
48 lines
Option Explicit
Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal reserved As Integer) As Integer
Global Const EW_REBOOTSYSTEM = &H43
Global Const EW_RESTARTWINDOWS = &H42
Global Const EW_EXITWINDOWS = &H0
Sub CentreForm (F As Form)
F.Left = (screen.Width - F.Width) / 2
F.Top = (screen.Height - F.Height) / 2
End Sub
Sub MakeForm3D (frm As Form)
Dim tppy As Integer
Dim tppx As Integer
tppy = screen.TwipsPerPixelY
tppx = screen.TwipsPerPixelX
frm.Line (frm.ScaleLeft, frm.ScaleTop)-(frm.ScaleLeft + frm.ScaleWidth, frm.ScaleTop), RGB(0, 0, 0)
frm.Line (frm.ScaleLeft + tppx, frm.ScaleTop + tppy)-(frm.ScaleLeft + frm.ScaleWidth - tppx, frm.ScaleTop + tppy), RGB(255, 255, 255)
frm.Line (frm.ScaleLeft, frm.ScaleTop)-(frm.ScaleLeft, frm.ScaleTop + frm.ScaleHeight - tppy), RGB(0, 0, 0)
frm.Line (frm.ScaleLeft + tppx, frm.ScaleTop + tppy)-(frm.ScaleLeft + tppx, frm.ScaleTop + frm.ScaleHeight - 2 * tppy), RGB(255, 255, 255)
frm.Line (frm.ScaleLeft, frm.ScaleTop + frm.ScaleHeight - tppy)-(frm.ScaleLeft + frm.ScaleWidth, frm.ScaleTop + frm.ScaleHeight - tppy), RGB(0, 0, 0)
frm.Line (frm.ScaleLeft + tppx, frm.ScaleTop + frm.ScaleHeight - 2 * tppy)-(frm.ScaleLeft + frm.ScaleWidth - 2 * tppx, frm.ScaleTop + frm.ScaleHeight - 2 * tppy), RGB(128, 128, 128)
frm.Line (frm.ScaleLeft + frm.ScaleWidth - tppx, frm.ScaleTop)-(frm.ScaleLeft + frm.ScaleWidth - tppx, frm.ScaleTop + frm.ScaleHeight - tppy), RGB(0, 0, 0)
frm.Line (frm.ScaleLeft + frm.ScaleWidth - 2 * tppx, frm.ScaleTop + 2 * tppy)-(frm.ScaleLeft + frm.ScaleWidth - 2 * tppx, frm.ScaleTop + frm.ScaleHeight - tppy), RGB(128, 128, 128)
End Sub
Sub WinExit (Choice As Integer)
Dim RetCode As Integer
Dim ActionCode As Long
ActionCode = Choose(Choice + 1, EW_EXITWINDOWS, EW_RESTARTWINDOWS, EW_REBOOTSYSTEM)
RetCode = ExitWindows(ActionCode, 0)
End Sub